this.onmessage = function(e){
  console.log(e)
  let result = 0;
  for(let i = 0;i<1000;i++){
    result += i
    this.postMessage({
      val:result
    })
  }
 
  this.close() // 内部终止
}


